#pragma once
#include "gamecomponent.h"
#include "../commons/Subject.h"
#include <string>
#include "Position.h"
#include "PoligonScreenPosition.h"
#include <Box2D/Dynamics/b2Body.h>

class Figure :
	public GameComponent, public Subject
{
private:
	float x_position;
	float y_position;
	std::string color;
	int redComponent, greenComponent, blueComponent;
	float rotation;
	bool static_flag;
	float mass;
	float initialRotation;

public:
	vector<Position*> points;
	b2Body* figureBody;
	Figure(void);

	void set_position(float x, float y);
	float getX_position();
	float getY_position();

	virtual void initPoints() {}
	vector<Position*> getPoints();
	void Figure::setPoints(vector<Position*> v);

	b2Body* getFigureBody() { return this->figureBody; }
	void setFigureBody(b2Body* figureBody) { this->figureBody = figureBody; }
	
	void setColor(std::string color);
	std::string getColor();
	
	void setRotation(float rotation);
	float getRotation();
	
	void setStaticFlag(bool flag);
	bool is_static();
	
	void setMass( float mass);
	float getMass();

	void setInitialRotation(float initialRotation);
	float getInitialRotation();

	void setRGBColor(int r, int g, int b);
	int getRedComponent();
	int getGreenComponent();
	int getBlueComponent();
	
	virtual void setScale(float scale) {}
	virtual float getScale() { return 1; }

	virtual float getWidth() { return 10; }
	virtual float getHigh() { return 10; }

	virtual string getName() { return "NataliaNatalia"; }

	virtual Figure* Figure::clone() { return NULL; };

	/*
	REDEFINIR:
	0-CIRCULO
	3-TRIANGULO
	4-RECTANGULO
	5-PENTAGONO
	6-HEXAGONO	
	*/
	virtual int getType() {
		return NULL;
	}

	~Figure(void);
};

